package com.zlhj.ex.Controller;

import com.zlhj.ex.service.ShengService;
import com.zlhj.ex.service.ShiService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author zsx
 * @date 2021/06/16 9:47
 */
@Api("sheng")
@Controller
@RequestMapping("/sheng")
public class ShengController {

    @Autowired
    private ShengService shengService;

    @Autowired
    private ShiService shiService;


//    @GetMapping("/")
//    @ResponseBody
//    @ApiOperation(value = "getShengList")
//    public Res getShengList(Model model){
//        List<Sheng> shengList = shengService.list();
//        for (Sheng sheng : shengList) {
//            QueryWrapper<Shi> wrapper = new QueryWrapper<>();
//            wrapper.eq("sheng_id",sheng.getId());
//            List<Shi> shiList = shiService.list(wrapper);
//            sheng.setShis(shiList);
//        }
//        //model.addAttribute("shengList",shengList);
//        if (shengList.size() > 0){
//            return new Res("200","success",shengList);
//        } else if (shengList.size() == 0){
//            return new Res("数据为空");
//        }
//        return new Res("error");
//    }


}
